using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dao;
using Common;
using Entities;
using AjaxPro;
namespace Doctors_WebForum.Admin
{
    public partial class Login : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            UserData userData = new UserData();
            string username = txtUserName.Text.Trim();
            string password = txtPassword.Text.Trim();

            Entities.User user = new User();
            user.UserName = username;
            user.Password = password;

            if (userData.CheckLogin(username, password) == true)
            {
                Session["user"] = user;
                Response.Redirect("Default.aspx", true);
            }
            else
            {
                lblMessage.Text = "Invalid username or password .Please try again!";
            }
        }


    }
}
